#pragma once
#include "Resource.h"
#include "req.h"
#define MAX_LOADSTRING 100
#include "Camera.h"
#include <vector>

using namespace std;
namespace FIRSTDX
{



	class Dx11app
	{
	public:
		void InitDx11(unsigned int width,
				unsigned int height,
				unsigned int freshRate,
				HWND window,
				bool fullscreen);
		
		Dx11app(HINSTANCE hInstance, int nCmdShow);

		virtual ~Dx11app();

		int runMainLoop();
		virtual void update();
		virtual void updateFrame() = 0;
		ID3DX11Effect* setupShaders(LPCTSTR fxName);

		void swapBuffer(bool sync);

	 
		inline HWND getHwnd(){return m_hWnd;}
		//dx11 
		ID3D11Device* m_device;
		ID3D11DeviceContext* m_context;
		IDXGISwapChain* m_swapChain;
		ID3D11RenderTargetView* m_rtview;
		ID3D11DepthStencilView* m_dsview;
		ID3D11RasterizerState* m_rs;		
		ID3D11InputLayout* m_inputLayout;

		vector<ID3DX11Effect*> m_effectVec;//shaders

		ID3D11DepthStencilState* depthStencilState;//for depth
private:
		//window
		HACCEL m_hAccelTable;
		HWND m_hWnd;




	};
}
